package com.dongdongshop.controller;

import com.dongdongshop.pojo.TbUser;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("home")
public class HomeController {

    @RequestMapping("orderSend")
    public String OrderSend(Model model) {
        TbUser user = (TbUser) SecurityUtils.getSubject().getPrincipal();
        if (null != user){
            model.addAttribute("tbUser",user.getUsername());
        }
        return "home-order-send";
    }

    @RequestMapping("toMyOrderReceive")
    public String toMyOrder(Model model) {
        TbUser user = (TbUser) SecurityUtils.getSubject().getPrincipal();
        if (null != user){
            model.addAttribute("tbUser",user.getUsername());
        }
        return "home-order-receive";
    }


}
